package com.peakmain.wanandroid.netmodule.net.http.convert;

import okhttp3.Response;
import okhttp3.ResponseBody;

/**
 * author ：Peakmain
 * version : 1.0
 * createTime：2020/2/22
 * mail:2726449200@qq.com
 * describe：网络数据转换为字符串
 */
public class StringConvert implements Convert<String>{
    @Override
    public String convertResponse(Response response) throws Throwable {
        ResponseBody body = response.body();
        if(body == null)return null;
        return body.string();
    }
}
